/** 
 * @author Tendo
 * @date 2021/7/17
 * @param {number[]} numbers
 * @param {number} target
 * @return {number[]} 
 * @desc 双指针
*/

const twoSum = (numbers, target) => {
    let left = 0,
        right = numbers.length-1
    while (left <= right) {
        let val = numbers[left] + numbers[right]
        if(val == target) {
            return [left+1, right+1]
        } else if (val > target) {
            --right
        } else {
            ++left
        }
    }
    return [-1,-1]
}